﻿using System;

namespace Mono.Cecil
{
	// Token: 0x02000027 RID: 39
	internal abstract class MetadataTable<TRow> : MetadataTable where TRow : struct
	{
		// Token: 0x1700003E RID: 62
		// (get) Token: 0x06000246 RID: 582 RVA: 0x000144A8 File Offset: 0x000126A8
		public sealed override int Length
		{
			get
			{
				return this.length;
			}
		}

		// Token: 0x06000247 RID: 583 RVA: 0x000144C0 File Offset: 0x000126C0
		public int AddRow(TRow row)
		{
			bool flag = this.rows.Length == this.length;
			if (flag)
			{
				this.Grow();
			}
			TRow[] array = this.rows;
			int num = this.length;
			this.length = num + 1;
			array[num] = row;
			return this.length;
		}

		// Token: 0x06000248 RID: 584 RVA: 0x00014510 File Offset: 0x00012710
		private void Grow()
		{
			TRow[] destinationArray = new TRow[this.rows.Length * 2];
			Array.Copy(this.rows, destinationArray, this.rows.Length);
			this.rows = destinationArray;
		}

		// Token: 0x06000249 RID: 585 RVA: 0x00002A20 File Offset: 0x00000C20
		public override void Sort()
		{
		}

		// Token: 0x04000093 RID: 147
		internal TRow[] rows = new TRow[2];

		// Token: 0x04000094 RID: 148
		internal int length;
	}
}
